package com.wx.mall.sys;

import com.wx.mall.sys.utils.RequestHandlerUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients(basePackages = "com.wx.mall")
@EnableHystrix
@ComponentScan(basePackages = {"com.wx.mall"})
public class SysApplication {

    // 注入RestTemplate
    @Bean
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }

    // 注入RestTemplate
    @Bean
    public RequestHandlerUtil getRequestHandlerUtil(){
        return new RequestHandlerUtil();
    }

    public static void main(String[] args) {
        SpringApplication.run(SysApplication.class, args);
    }
}
